import request from '@/utils/request'

// 查询生产退料列表
export function listMaterial_return(query) {
  return request({
    url: '/yyj/wm/inbound/material_return/list',
    method: 'get',
    params: query
  })
}

// 查询生产退料详细
export function getMaterial_return(pmrCode) {
  return request({
    url: '/yyj/wm/inbound/material_return/' + pmrCode,
    method: 'get'
  })
}

// 新增生产退料
export function addMaterial_return(data) {
  return request({
    url: '/yyj/wm/inbound/material_return',
    method: 'post',
    data: data
  })
}

// 修改生产退料
export function updateMaterial_return(data) {
  return request({
    url: '/yyj/wm/inbound/material_return',
    method: 'put',
    data: data
  })
}

// 删除生产退料
export function delMaterial_return(pmrCode) {
  return request({
    url: '/yyj/wm/inbound/material_return/' + pmrCode,
    method: 'delete'
  })
}

// 查询工艺路线
export function getRouteCode() {
  return request({
    url: '/yyj/wm/inbound/material_return/route/code',
    method: 'get'
  })
}

// 查询工序
export function getProcedureCode() {
  return request({
    url: '/yyj/wm/inbound/material_return/procedure/code',
    method: 'get'
  })
}

// 查询物料清单
export function getMaterialList() {
  return request({
    url: '/yyj/wm/inbound/material_return/material/list',
    method: 'get'
  })
}

// 查询班组
export function listWorkGroup() {
  return request({
    url: '/yyj/wm/inbound/material_return/work_group/list',
    method: 'get'
  })
}

// 查询生产工单
export function listWorkOrder(query) {
  return request({
    url: '/yyj/wm/inbound/material_return/work_order/list',
    method: 'get',
    params: query
  })
}

// 查询工单任务
export function listWorkTask(query) {
  return request({
    url: '/yyj/wm/inbound/material_return/work_task/list',
    method: 'get',
    params: query
  })
}

// 查询仓库负责人
export function listTaskManager() {
  return request({
    url: '/yyj/wm/inbound/material_return/task_manager/list',
    method: 'get'
  })
}

// 查询物料
export function listMaterial(query) {
  return request({
    url: '/yyj/wm/inbound/material_return/material_list/get',
    method: 'get',
    params: query
  })
}

// 查询单位
export function listUnit() {
  return request({
    url: '/yyj/wm/inbound/material_return/unit/list',
    method: 'get'
  })
}

// 查询仓库编码
export function getWCode(query) {
  return request({
    url: '/yyj/wm/warehouse/manage/list/codes',
    method: 'get',
    params: query
  })
}

// 查询库区编码
export function getSaCode(query) {
  return request({
    url: '/yyj/wm/warehouse/area/list/codes',
    method: 'get',
    params: query
  })
}

// 查询库位编码
export function getSlCode(query) {
  return request({
    url: '/yyj/wm/warehouse/location/list/codes',
    methods: 'get',
    params: query,
  })
}

// 生产退料入库
export function storeMaterial_return(data) {
  return request({
    url: '/yyj/wm/inbound/material_return/store',
    method: 'put',
    data: data
  })
}
